package service.myservice.panduan;

import java.util.HashMap;
import java.util.Map;

import service.vo.MessageVo;

public class PanduanServiceImpl implements PanduanService {

	@Override
	public Map<String, MessageVo> getVO(String name) {
		String path;
		MessageVo messageVo = new MessageVo();
		if(isUser(name)){
			messageVo.setUsername(name);
			messageVo.setSex("女");
			messageVo.setMess("hello world");
			path = "success";
		} else {
			messageVo.setUsername(name);
			messageVo.setSex("男");
			messageVo.setMess("mess");
			path = "fail";
		}
		Map<String, MessageVo> map = new HashMap<>();
		map.put(path, messageVo);
		return map;
	}
	
	private boolean isUser(String name) {
		boolean flag = false;
		if(name.equals("cyr")){
			flag = true;
		}
		return flag;
	}
}
